# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=neon
pkgver=0.32.2
pkgrel=0
pkgdesc="HTTP and WebDAV client library with a C interface"
url="https://notroj.github.io/neon/"
arch="all"
license="LGPL-2.0-or-later"
makedepends="expat-dev openssl1.1-compat-dev zlib-dev gzip xmlto
	autoconf automake libtool"
checkdepends="openssl"
depends="ca-certificates"
depends_dev="$makedepends"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/notroj/neon/archive/$pkgver.tar.gz"
# /usr/bin/openssl invocation fails in testsuite, not sure why
options="!check"

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--with-ssl \
		--with-expat \
		--without-gssapi \
		--disable-nls \
		--enable-shared \
		--disable-static \
		--enable-threadsafe-ssl=posix \
		--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
	make && make docs
}

check() {
	make check
}

package() {
	make -j1 DESTDIR="$pkgdir" install
}
sha512sums="
f207057e82ddc674664d13d7c7bc8236f7a886395eefe1af9e38cd3baf2ecb1905671ac8db02270e00a3baceca6ba5165f26d8e42919c99e571d9ca5d91e0ca3  neon-0.32.2.tar.gz
"
